home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
COMMUNIC
/
MRUN211.ZIP
/
MRUN211C.WAS
< prev
next >
Wrap
Text File
|
1993-05-01
|
24KB
|
915 lines
;MailRun v2.11: Part C, changebbs
;1992-1993 Gerald P. Sully, all rights reserved.
#comment
**************************************************************************
**************************************************************************
*
* This file contains routines related to changing BBS settings.
* Settings are divided into three groups, each with its own
* dialog box: BBS Settings, BBS Prompts, and Mail Door Prompts.
* The appropriate routine is selected with a FLAG.
*
**************************************************************************
**************************************************************************
#endcomment
#define MRUN211C
#define MRUN211BC
#include "mrun211.h"
string ProtList, ArcList, MailDoorList, BBSTypeList, BBSChoice
#comment
*********************************************************************
*
* MAIN()
*
* Calls checkchild(), makemaildoorlist(), menudim(),
* makebbstypelist(), makeprotlist(), changeprompts(),
* changeuserinfo(), changemaildoor()
*
* Dispatches the appropriate command based on the value
* of FLAGS.
*
*********************************************************************
#endcomment
proc main
integer cmdstatus
menudim()
checkchild()
findfirst MailRun
MailRunTrunc = $FILENAME
makeprotlist()
makebbstypelist()
makemaildoorlist()
cmdstatus = FLAGS & (USR + PRMPT + QMD)
switch cmdstatus
case USR
changeuserinfo()
endcase
case PRMPT
changeprompts()
endcase
case QMD
changemaildoor()
endcase
endswitch
endproc
#comment
*********************************************************************
*
* CHANGEUSERINFO()
*
* Called by main()
*
* Calls makebbslist(), loadbbsinfo(), loadprompts(),
* loadmaildoor(), writebbsinfo(), writeprompts(),
* writemaildoor(), interfaceon(), insertbbs(),
* bbsbox(), addbbs(), defaultsprompts(), defaultsdoor(),
* cfgprompts(), cfgmaildoor(), checkchanged(),
* gettaskstring()
*
* Puts up the BBS Information dialog box and allows the
* user to change the values for the current BBS. If the
* the DEFAULTS flag is set, changes the DEFAULT BBS
* settings. If the NEW flag is set, calls addbbs().
*
*********************************************************************
#endcomment
proc changeuserinfo
string LastBBS, LastBBSType, BBSid, char
integer dialogstatus, NameChanged, i
if FLAGS & DEFAULTS
BBSList = "DEFAULT"
BBSChoice = "DEFAULT"
loadbbsinfo(MailRun, "DEFAULT")
loadprompts(MailRunIni, BBSType)
loadmaildoor(MailRunIni, MailDoorType)
findfirst MailRun
strfmt BBSName "BBS Info Defaults for %s" $FILENAME
else
makebbslist()
strextract BBSChoice TaskItem "`t" 3
loadbbsinfo(MailRun, BBSChoice)
loadprompts(MailRun, BBSChoice)
loadmaildoor(MailRun, BBSChoice)
endif
NameChanged = 0
LastBBS = BBSChoice
LastBBSType = BBSType
bbsbox()
interfaceon()
FLAGS &= UNCHANGED
if FLAGS & NEW
addbbs()
LastBBS = BBSChoice
endif
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 10
;User selected "Prompts"
if FLAGS & DEFAULTS
defaultsprompts()
else
cfgprompts()
endif
endcase
case 11
;User selected "Mail Door"
if FLAGS & DEFAULTS
defaultsdoor()
else
cfgmaildoor()
endif
endcase
case 12
;User selected "Save"
if NULLSTR BBSName
usermsg "You must enter the name of the BBS!"
loopwhile
elseif FLAGS & NEW
;if it is a new BBS
if not NULLSTR TaskItem
;if there are other BBSs in the mailrun
strextract BBSid TaskItem "`t" 3
insertbbs(BBSid, BBSChoice)
else
;if this is the only BBS in the mailrun
writebbs(1, BBSChoice)
endif
TaskItem = gettaskstring(BBSid, 0)
FLAGS &= OLD
endif
if FLAGS & DEFAULTS
writebbsinfo(MailRun, "DEFAULT")
writeprompts(MailRunIni, BBSType)
writemaildoor(MailRunIni, MailDoorType)
else
writebbsinfo(MailRun, BBSChoice)
writeprompts(MailRun, BBSChoice)
writemaildoor(MailRun, BBSChoice)
endif
strextract char TaskItem "`t" 4
atoi char i
if NameChanged && !(i)
TaskItem = gettaskstring(BBSChoice, 0)
endif
FLAGS &= UNCHANGED
endcase
case 13
;User selected "Done:
if checkchanged()
exit
endif
endcase
case 171
;User changed the BBS type
if FLAGS & DEFAULTS
if checkchanged()
loadprompts(MailRunIni, BBSType)
FLAGS &= UNCHANGED
LastBBSType = BBSType
else
BBSType = LastBBSType
endif
else
loadprompts(MailRunIni, BBSType)
endif
FLAGS |= CHANGED
updatedlg -1
endcase
case 172
;User changed the mail door type
if FLAGS & DEFAULTS
loadmaildoor(MailRunIni, MailDoorType)
else
loadmaildoor(MailRunIni, MailDoorType)
endif
FLAGS |= CHANGED
endcase
case 173
;User changed BBS ID with combobox
if checkchanged()
loadbbsinfo(MailRun, BBSChoice)
loadprompts(MailRun, BBSChoice)
loadmaildoor(MailRun, BBSChoice)
TaskItem = gettaskstring(BBSChoice, 0)
FLAGS &= UNCHANGED
LastBBS = BBSChoice
updatedlg -1
else
BBSChoice = LastBBS
updatedlg 512
endif
endcase
case 230
NameChanged = 1
FLAGS |= CHANGED
endcase
case 70
case 170
case 231
case 232
case 233
case 234
case 235
case 236
case 237
case 238
case 239
FLAGS |= CHANGED
endcase
endswitch
endwhile
endproc
#comment
*********************************************************************
*
* CHANGEPROMPTS()
*
* Called by main()
*
* Calls makebbslist(), promptbox(), loadprompts(),
* writeprompts(), interfaceon(), defaultsbbs(), defaultsdoor(),
* cfgbbs(), cfgmaildoor(), exportprompts(), checkchanged(),
* gettaskstring()
*
* Allows the user to change the prompts for a given BBS in
* the *.MRN file. If DEFAULTS flag is set, changes default
* prompts for the current BBS type.
*
*********************************************************************
#endcomment
proc changeprompts
string LastBBS, LastBBSType
integer dialogstatus
if FLAGS & DEFAULTS
BBSList = "DEFAULT"
BBSChoice = "DEFAULT"
profilerd MailRun "DEFAULT" "BBSType" BBSType
loadprompts(MailRunIni, BBSType)
else
makebbslist()
strextract BBSChoice TaskItem "`t" 3
profilerd MailRun BBSChoice "BBSType" BBSType
loadprompts(MailRun, BBSChoice)
endif
LastBBS = BBSChoice
LastBBSType = BBSType
promptbox()
FLAGS &= UNCHANGED
interfaceon()
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 10
;User selected "BBS Info"
if FLAGS & DEFAULTS
defaultsbbs()
else
cfgbbs()
endif
endcase
case 11
;User selected "Mail Door"
if FLAGS & DEFAULTS
defaultsdoor()
else
cfgmaildoor()
endif
endcase
case 12
;User selected "Export"
exportprompts()
endcase
case 13
;User selected "Save"
if FLAGS & DEFAULTS
writeprompts(MailRunIni, BBSType)
else
writeprompts(MailRun, BBSChoice)
profilewr MailRun BBSChoice "BBSType" BBSType
endif
FLAGS &= UNCHANGED
endcase
case 14
;User selected "Done"
if checkchanged()
exit
endif
endcase
case 170
;User changed BBS with the combobox
if checkchanged()
loadprompts(MailRun, BBSChoice)
profilerd MailRun BBSChoice "BBSType" BBSType
TaskItem = gettaskstring(BBSChoice, 0)
LastBBS = BBSChoice
updatedlg -1
else
BBSChoice = LastBBS
updatedlg 512
endif
endcase
case 171
;User changed BBS type
if FLAGS & DEFAULTS
if checkchanged()
loadprompts(MailRunIni, BBSType)
updatedlg 128
FLAGS &= UNCHANGED
LastBBSType = BBSType
else
BBSType = LastBBSType
updatedlg 512
endif
else
loadprompts(MailRunIni, BBSType)
updatedlg 128
FLAG